## Loading tokens via the main script
## 
## Data:
##     nsfg
## Network:
##     p
## Terms:
##     edges + 
##                                  nodecov("age") + 
##                                     nodecov("agesq") +
##                                     nodefactor("race", base=5) + 
##                                     nodematch("race", diff=TRUE) +
##                                     absdiff("sqrt.age.adj") +
##                                  nodefactor("sex.ident", base=1:2) +
##                                     degree(1, by="sb") +
##                                     nodefactor("dsb.cohab", base=1)
## Offsets:
##     offset(nodematch("sex", diff=FALSE))
## Constraints:
##     ~bd(maxout=3)
## loadfit:
##     FALSE
## Saving to:
##     /net/proj/SHAMPnetdat/model-fits/archive/may-jkb
## burnin=1e6, mcmc.int=1e5

1 Model information

Note: bb stands for “better burnin”

## 
## --------------------------------------
## [1] "Tuesday, September 04, 2018"
## [1] "14:43"
## 
## --------------------------------------
## 
## Model: pers_bbi_conc_Gb245
## 
##        nsfg data and network p
## egoobj ~ edges + nodecov("age") + nodecov("agesq") + nodefactor("race", 
##     base = 5) + nodematch("race", diff = TRUE) + absdiff("sqrt.age.adj") + 
##     nodefactor("sex.ident", base = 1:2) + degree(1, by = "sb") + 
##     nodefactor("dsb.cohab", base = 1) + offset(nodematch("sex", 
##     diff = FALSE))
## 
## --------------------------------------

2 Sufficient statistics

Edit this based on the model being assessed

summary_statistics_ego(as.formula(term.formula), popsize=50000)
## Constructing pseudopopulation network.
## Note: Constructed network has size 48210, different from requested 50000. Estimation should not be meaningfully affected.
## 
## Original weights summary:
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##   0.0429   4.2370  11.5156  22.9393  27.3059 355.4855 
## 
## Unweighted weights summary:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##       1       1       1       1       1       1 
## 
## ----------------------------------------
## All stats scaled to popsize of  48210 
## ----------------------------------------
##                                   Weighted Unweighted RatioWtoUW
## edges                               4496.8     6795.0        0.7
## nodecov.age                       256104.7   384226.7        0.7
## nodecov.agesq                    7871208.2 11738983.7        0.7
## nodefactor.race.B                    735.2     3907.9        0.2
## nodefactor.race.BI                   354.2      581.1        0.6
## nodefactor.race.H                    672.9     1670.9        0.4
## nodefactor.race.HI                   483.4      988.5        0.5
## nodematch.race.B                     257.6     1561.4        0.2
## nodematch.race.BI                     97.6       89.9        1.1
## nodematch.race.H                      99.8      346.6        0.3
## nodematch.race.HI                    125.0      257.4        0.5
## nodematch.race.W                    3040.5     2680.3        1.1
## absdiff.sqrt.age.adj                1407.7     2255.3        0.6
## nodefactor.sex.ident.msmf             64.8       85.1        0.8
## deg1.sbF.B                           308.4     2247.2        0.1
## deg1.sbF.NB                         3661.6     4551.1        0.8
## deg1.sbM.B                           297.7     1317.5        0.2
## deg1.sbM.NB                         4000.6     3953.9        1.0
## nodefactor.dsb.cohab.deg1pl.F.B        4.4       31.1        0.1
## nodefactor.dsb.cohab.deg1pl.F.NB      57.3       77.0        0.7
## nodefactor.dsb.cohab.deg1pl.M.B       10.5       40.5        0.3
## nodefactor.dsb.cohab.deg1pl.M.NB     107.5      109.5        1.0
str(egoobj)
## List of 4
##  $ egos    :'data.frame':    35677 obs. of  32 variables:
##   ..$ weight        : num [1:35677] 9.77 27.46 23.37 11.12 26.72 ...
##   ..$ ego           : int [1:35677] 1 2 3 4 5 6 7 8 9 10 ...
##   ..$ sex           : chr [1:35677] "F" "F" "F" "F" ...
##   ..$ age           : num [1:35677] 41 37 42 38 43 44 42 44 39 40 ...
##   ..$ sqrt.age      : num [1:35677] 6.4 6.08 6.48 6.16 6.56 ...
##   ..$ sex.ident     : chr [1:35677] "f" "f" "f" "f" ...
##   ..$ immigrant     : chr [1:35677] "No" "No" "No" "No" ...
##   ..$ role.class    : chr [1:35677] "R" "R" "R" "R" ...
##   ..$ otcount       : num [1:35677] 0 0 0 0 0 0 0 0 0 0 ...
##   ..$ race          : chr [1:35677] "W" "W" "W" "W" ...
##   ..$ race3         : chr [1:35677] "W" "W" "W" "W" ...
##   ..$ deg.cohab     : num [1:35677] 0 1 0 1 1 0 1 0 1 1 ...
##   ..$ deg.pers      : num [1:35677] 1 0 1 0 0 1 0 1 0 0 ...
##   ..$ raceimm       : chr [1:35677] "W" "W" "W" "W" ...
##   ..$ agesq         : num [1:35677] 1681 1369 1764 1444 1849 ...
##   ..$ demog.cat     : num [1:35677] 1541 1537 1542 1538 1543 ...
##   ..$ sqrt.age.adj  : num [1:35677] 6.52 6.2 6.6 6.29 6.68 ...
##   ..$ msmf          : num [1:35677] 0 0 0 0 0 0 0 0 0 0 ...
##   ..$ agecat        : chr [1:35677] "36-45" "36-45" "36-45" "36-45" ...
##   ..$ race.sex      : chr [1:35677] "W.F" "W.F" "W.F" "W.F" ...
##   ..$ deg.pers.c    : num [1:35677] 1 0 1 0 0 1 0 1 0 0 ...
##   ..$ deg.cohab.c   : num [1:35677] 0 1 0 1 1 0 1 0 1 1 ...
##   ..$ dsb.pers      : chr [1:35677] "deg1pl.F.NB" "deg0" "deg1pl.F.NB" "deg0" ...
##   ..$ dsb.cohab     : chr [1:35677] "deg0" "deg1pl.F.NB" "deg0" "deg1pl.F.NB" ...
##   ..$ ds.pers       : chr [1:35677] "deg1pl.F" "deg0" "deg1pl.F" "deg0" ...
##   ..$ ds.cohab      : chr [1:35677] "deg0" "deg1pl.F" "deg0" "deg1pl.F" ...
##   ..$ sb            : chr [1:35677] "F.NB" "F.NB" "F.NB" "F.NB" ...
##   ..$ p.conc        : chr [1:35677] "non-B.F" "non-B.F" "non-B.F" "non-B.F" ...
##   ..$ xfour.conc    : chr [1:35677] "non.B.BI.M.c-0" "non.B.BI.M.c-1" "non.B.BI.M.c-0" "non.B.BI.M.c-1" ...
##   ..$ x.conc        : chr [1:35677] "F.c-0" "non.B.BI.M.c-1.F.c-1" "F.c-0" "non.B.BI.M.c-1.F.c-1" ...
##   ..$ race.sex.pers : chr [1:35677] "W.F.p1" "W.F.p0" "W.F.p1" "W.F.p0" ...
##   ..$ race.sex.cohab: chr [1:35677] "W.F.p0" "W.F.p1" "W.F.p0" "W.F.p1" ...
##  $ alters  :'data.frame':    10057 obs. of  12 variables:
##   ..$ ego         : int [1:10057] 1 3 6 8 19 35 54 55 60 61 ...
##   ..$ age         : num [1:10057] 47 58 54 45 41 55 45 51 48 24 ...
##   ..$ sqrt.age    : num [1:10057] 6.86 7.62 7.35 6.71 6.4 ...
##   ..$ sex         : chr [1:10057] "M" "M" "M" "M" ...
##   ..$ race        : chr [1:10057] "W" "W" "W" "W" ...
##   ..$ race3       : chr [1:10057] "W" "W" "W" "W" ...
##   ..$ immigrant   : chr [1:10057] "No" "No" "No" "No" ...
##   ..$ len         : num [1:10057] 36 54 43 68 1 67 26 18 156 7 ...
##   ..$ raceimm     : chr [1:10057] "W" "W" "W" "W" ...
##   ..$ agesq       : num [1:10057] 2209 3364 2916 2025 1681 ...
##   ..$ sqrt.age.adj: num [1:10057] 6.86 7.62 7.35 6.71 6.4 ...
##   ..$ race.sex    : chr [1:10057] "W.M" "W.M" "W.M" "W.M" ...
##  $ egoWt   : num [1:35677] 9.77 27.46 23.37 11.12 26.72 ...
##  $ egoIDcol: chr "ego"
##  - attr(*, "class")= chr "egodata"

3 Estimate or load models

startclock <- proc.time()

Assign “fit” object, either from loaded models or by estimating a new model

if (loadfit) {
    fit <- readRDS(rds.location)
} else {
    fit <- ergm.ego(as.formula(model.call),
                    offset.coef = offset.coefs,
                    constraints=as.formula(constraints),
                    control=control.ergm.ego(ppopsize=50000, 
                         ppop.wt='sample',
                                             stats.est="asymptotic",
                                             ergm.control = 
                                                 control.ergm(MCMC.interval=1e5,
                                                              MCMC.samplesize=7500,
                                                              MCMC.burnin = 1e6,
                                                              MPLE.max.dyad.types = 1e7,
                                                              init.method = "zeros",
                                                              MCMLE.maxit = 400,
                                  parallel = np, 
                                  parallel.type="PSOCK"
                                                              )))
   cat('\n---------------------------------------\n')
   cat('\nHOORAY, the model converged! Saving....\n')
   saveRDS(fit, rds.location)
}
## Constructing pseudopopulation network.
## Unable to match target stats. Using MCMLE estimation.
## Starting maximum likelihood estimation via MCMLE:
## Iteration 1 of at most 400:
## Optimizing with step length 0.020779006560131.
## The log-likelihood improved by 4.468.
## Iteration 2 of at most 400:
## Optimizing with step length 0.0213045949830756.
## The log-likelihood improved by 4.26.
## Iteration 3 of at most 400:
## Optimizing with step length 0.0228841719262391.
## The log-likelihood improved by 4.485.
## Iteration 4 of at most 400:
## Optimizing with step length 0.0222005701526763.
## The log-likelihood improved by 4.072.
## Iteration 5 of at most 400:
## Optimizing with step length 0.0229377524534442.
## The log-likelihood improved by 4.219.
## Iteration 6 of at most 400:
## Optimizing with step length 0.0245385729709628.
## The log-likelihood improved by 4.595.
## Iteration 7 of at most 400:
## Optimizing with step length 0.024641256790322.
## The log-likelihood improved by 4.331.
## Iteration 8 of at most 400:
## Optimizing with step length 0.0254294595535608.
## The log-likelihood improved by 4.529.
## Iteration 9 of at most 400:
## Optimizing with step length 0.0254818025695331.
## The log-likelihood improved by 4.315.
## Iteration 10 of at most 400:
## Optimizing with step length 0.0247020625905488.
## The log-likelihood improved by 3.921.
## Iteration 11 of at most 400:
## Optimizing with step length 0.0254334917978917.
## The log-likelihood improved by 4.021.
## Iteration 12 of at most 400:
## Optimizing with step length 0.0246989427335922.
## The log-likelihood improved by 3.786.
## Iteration 13 of at most 400:
## Optimizing with step length 0.0254332848859402.
## The log-likelihood improved by 3.735.
## Iteration 14 of at most 400:
## Optimizing with step length 0.0278314632096548.
## The log-likelihood improved by 4.35.
## Iteration 15 of at most 400:
## Optimizing with step length 0.0272178715030562.
## The log-likelihood improved by 3.999.
## Iteration 16 of at most 400:
## Optimizing with step length 0.0271743389248697.
## The log-likelihood improved by 4.028.
## Iteration 17 of at most 400:
## Optimizing with step length 0.0287442551286399.
## The log-likelihood improved by 4.153.
## Iteration 18 of at most 400:
## Optimizing with step length 0.0272828248614569.
## The log-likelihood improved by 3.81.
## Iteration 19 of at most 400:
## Optimizing with step length 0.0279656495432959.
## The log-likelihood improved by 3.804.
## Iteration 20 of at most 400:
## Optimizing with step length 0.0280154340234283.
## The log-likelihood improved by 3.679.
## Iteration 21 of at most 400:
## Optimizing with step length 0.0280190689730531.
## The log-likelihood improved by 3.643.
## Iteration 22 of at most 400:
## Optimizing with step length 0.0288074663707811.
## The log-likelihood improved by 3.853.
## Iteration 23 of at most 400:
## Optimizing with step length 0.0304459696757107.
## The log-likelihood improved by 4.026.
## Iteration 24 of at most 400:
## Optimizing with step length 0.0305758834953522.
## The log-likelihood improved by 4.095.
## Iteration 25 of at most 400:
## Optimizing with step length 0.032172375883868.
## The log-likelihood improved by 4.3.
## Iteration 26 of at most 400:
## Optimizing with step length 0.033898311711593.
## The log-likelihood improved by 4.705.
## Iteration 27 of at most 400:
## Optimizing with step length 0.0324513558604096.
## The log-likelihood improved by 4.157.
## Iteration 28 of at most 400:
## Optimizing with step length 0.0323294171278058.
## The log-likelihood improved by 4.187.
## Iteration 29 of at most 400:
## Optimizing with step length 0.0315227092640032.
## The log-likelihood improved by 3.755.
## Iteration 30 of at most 400:
## Optimizing with step length 0.0330464252956803.
## The log-likelihood improved by 4.049.
## Iteration 31 of at most 400:
## Optimizing with step length 0.0331773295387149.
## The log-likelihood improved by 3.976.
## Iteration 32 of at most 400:
## Optimizing with step length 0.0347848171412601.
## The log-likelihood improved by 4.487.
## Iteration 33 of at most 400:
## Optimizing with step length 0.0341288239466004.
## The log-likelihood improved by 4.106.
## Iteration 34 of at most 400:
## Optimizing with step length 0.0356706012003544.
## The log-likelihood improved by 4.27.
## Iteration 35 of at most 400:
## Optimizing with step length 0.0334045841848464.
## The log-likelihood improved by 3.675.
## Iteration 36 of at most 400:
## Optimizing with step length 0.0348052913502519.
## The log-likelihood improved by 3.938.
## Iteration 37 of at most 400:
## Optimizing with step length 0.0365343710277241.
## The log-likelihood improved by 4.319.
## Iteration 38 of at most 400:
## Optimizing with step length 0.0350890874621015.
## The log-likelihood improved by 3.889.
## Iteration 39 of at most 400:
## Optimizing with step length 0.0325522180711526.
## The log-likelihood improved by 3.423.
## Iteration 40 of at most 400:
## Optimizing with step length 0.037119424032721.
## The log-likelihood improved by 4.142.
## Iteration 41 of at most 400:
## Optimizing with step length 0.0399767860222244.
## The log-likelihood improved by 4.51.
## Iteration 42 of at most 400:
## Optimizing with step length 0.0370277323540736.
## The log-likelihood improved by 3.864.
## Iteration 43 of at most 400:
## Optimizing with step length 0.0383562531991609.
## The log-likelihood improved by 4.107.
## Iteration 44 of at most 400:
## Optimizing with step length 0.0368720829575921.
## The log-likelihood improved by 3.662.
## Iteration 45 of at most 400:
## Optimizing with step length 0.0399513299511839.
## The log-likelihood improved by 4.225.
## Iteration 46 of at most 400:
## Optimizing with step length 0.0427034499930273.
## The log-likelihood improved by 4.697.
## Iteration 47 of at most 400:
## Optimizing with step length 0.0421907872766029.
## The log-likelihood improved by 4.423.
## Iteration 48 of at most 400:
## Optimizing with step length 0.0421349446738971.
## The log-likelihood improved by 4.07.
## Iteration 49 of at most 400:
## Optimizing with step length 0.0421288684488979.
## The log-likelihood improved by 4.229.
## Iteration 50 of at most 400:
## Optimizing with step length 0.0462050463054713.
## The log-likelihood improved by 4.683.
## Iteration 51 of at most 400:
## Optimizing with step length 0.0425751077738953.
## The log-likelihood improved by 3.735.
## Iteration 52 of at most 400:
## Optimizing with step length 0.0454416421232925.
## The log-likelihood improved by 4.092.
## Iteration 53 of at most 400:
## Optimizing with step length 0.047421172621361.
## The log-likelihood improved by 4.409.
## Iteration 54 of at most 400:
## Optimizing with step length 0.0460119657362954.
## The log-likelihood improved by 4.002.
## Iteration 55 of at most 400:
## Optimizing with step length 0.0507820419485315.
## The log-likelihood improved by 4.666.
## Iteration 56 of at most 400:
## Optimizing with step length 0.0472456212368906.
## The log-likelihood improved by 3.743.
## Iteration 57 of at most 400:
## Optimizing with step length 0.0501169880613247.
## The log-likelihood improved by 4.029.
## Iteration 58 of at most 400:
## Optimizing with step length 0.0496564796365911.
## The log-likelihood improved by 3.81.
## Iteration 59 of at most 400:
## Optimizing with step length 0.0495977304853423.
## The log-likelihood improved by 3.573.
## Iteration 60 of at most 400:
## Optimizing with step length 0.0529089807448927.
## The log-likelihood improved by 3.803.
## Iteration 61 of at most 400:
## Optimizing with step length 0.0583751468447614.
## The log-likelihood improved by 4.368.
## Iteration 62 of at most 400:
## Optimizing with step length 0.0583458087153091.
## The log-likelihood improved by 4.221.
## Iteration 63 of at most 400:
## Optimizing with step length 0.0549559216455784.
## The log-likelihood improved by 3.567.
## Iteration 64 of at most 400:
## Optimizing with step length 0.0595192170081394.
## The log-likelihood improved by 3.717.
## Iteration 65 of at most 400:
## Optimizing with step length 0.0661545701222598.
## The log-likelihood improved by 4.452.
## Iteration 66 of at most 400:
## Optimizing with step length 0.06899543580401.
## The log-likelihood improved by 4.347.
## Iteration 67 of at most 400:
## Optimizing with step length 0.0668934756687018.
## The log-likelihood improved by 3.844.
## Iteration 68 of at most 400:
## Optimizing with step length 0.0682618148327037.
## The log-likelihood improved by 3.789.
## Iteration 69 of at most 400:
## Optimizing with step length 0.0754208521494146.
## The log-likelihood improved by 4.059.
## Iteration 70 of at most 400:
## Optimizing with step length 0.0794238486481471.
## The log-likelihood improved by 4.29.
## Iteration 71 of at most 400:
## Optimizing with step length 0.0766809988410379.
## The log-likelihood improved by 3.554.
## Iteration 72 of at most 400:
## Optimizing with step length 0.0893695850688403.
## The log-likelihood improved by 4.468.
## Iteration 73 of at most 400:
## Optimizing with step length 0.0913123476517793.
## The log-likelihood improved by 4.109.
## Iteration 74 of at most 400:
## Optimizing with step length 0.0999303600045934.
## The log-likelihood improved by 4.36.
## Iteration 75 of at most 400:
## Optimizing with step length 0.107617508608955.
## The log-likelihood improved by 4.38.
## Iteration 76 of at most 400:
## Optimizing with step length 0.113414922835202.
## The log-likelihood improved by 4.339.
## Iteration 77 of at most 400:
## Optimizing with step length 0.119774723704254.
## The log-likelihood improved by 4.26.
## Iteration 78 of at most 400:
## Optimizing with step length 0.121639331726847.
## The log-likelihood improved by 3.553.
## Iteration 79 of at most 400:
## Optimizing with step length 0.135681240302518.
## The log-likelihood improved by 3.826.
## Iteration 80 of at most 400:
## Optimizing with step length 0.15215524970127.
## The log-likelihood improved by 4.024.
## Iteration 81 of at most 400:
## Optimizing with step length 0.172635270505266.
## The log-likelihood improved by 4.029.
## Iteration 82 of at most 400:
## Optimizing with step length 0.209365817227483.
## The log-likelihood improved by 4.598.
## Iteration 83 of at most 400:
## Optimizing with step length 0.221303491466976.
## The log-likelihood improved by 3.746.
## Iteration 84 of at most 400:
## Optimizing with step length 0.27297194270188.
## The log-likelihood improved by 4.03.
## Iteration 85 of at most 400:
## Optimizing with step length 0.331827753531792.
## The log-likelihood improved by 3.803.
## Iteration 86 of at most 400:
## Optimizing with step length 0.459145950450701.
## The log-likelihood improved by 4.113.
## Iteration 87 of at most 400:
## Optimizing with step length 0.717482014956729.
## The log-likelihood improved by 3.835.
## Iteration 88 of at most 400:
## Optimizing with step length 1.
## The log-likelihood improved by 0.9899.
## Step length converged once. Increasing MCMC sample size.
## Iteration 89 of at most 400:
## Optimizing with step length 1.
## The log-likelihood improved by 0.04685.
## Step length converged twice. Stopping.
## Note: The constraint on the sample space is not dyad-independent. Null model likelihood is only implemented for dyad-independent constraints at this time. Number of observations is similarly ill-defined.
## This model was fit using MCMC.  To examine model diagnostics and check for degeneracy, use the mcmc.diagnostics() function.
## 
## ---------------------------------------
## 
## HOORAY, the model converged! Saving....

3.1 Fit or load time

Fit time: 802 minutes.

3.2 summary.ergm.ego

## Note: The constraint on the sample space is not dyad-independent. Null model likelihood is only implemented for dyad-independent constraints at this time. Number of observations is similarly ill-defined.
## 
## ==========================
## Summary of model fit
## ==========================
## 
## Formula:   egoobj ~ edges + nodecov("age") + nodecov("agesq") + nodefactor("race", 
##     base = 5) + nodematch("race", diff = TRUE) + absdiff("sqrt.age.adj") + 
##     nodefactor("sex.ident", base = 1:2) + degree(1, by = "sb") + 
##     nodefactor("dsb.cohab", base = 1) + offset(nodematch("sex", 
##     diff = FALSE))
## 
## Iterations:  89 out of 400 
## 
## Monte Carlo MLE Results:
##                                    Estimate Std. Error MCMC %  p-value    
## netsize.adj                      -1.082e+01  0.000e+00      0  < 1e-04 ***
## edges                             5.305e+00  9.549e-01      0  < 1e-04 ***
## nodecov.age                      -2.336e-01  3.375e-02      0  < 1e-04 ***
## nodecov.agesq                     3.786e-03  5.585e-04      0  < 1e-04 ***
## nodefactor.race.B                 1.295e+00  1.407e-01      0  < 1e-04 ***
## nodefactor.race.BI                1.830e+00  1.711e-01      0  < 1e-04 ***
## nodefactor.race.H                 1.995e+00  1.055e-01      0  < 1e-04 ***
## nodefactor.race.HI                1.128e+00  1.145e-01      0  < 1e-04 ***
## nodematch.race.B                  3.214e+00  1.346e-01      0  < 1e-04 ***
## nodematch.race.BI                 2.815e+00  2.316e-01      0  < 1e-04 ***
## nodematch.race.H                  2.633e-01  1.260e-01      0 0.036613 *  
## nodematch.race.HI                 2.263e+00  1.644e-01      0  < 1e-04 ***
## nodematch.race.W                  2.162e+00  1.059e-01      0  < 1e-04 ***
## absdiff.sqrt.age.adj             -2.594e+00  6.190e-02      0  < 1e-04 ***
## nodefactor.sex.ident.msmf        -9.486e-01  2.819e-01      0 0.000764 ***
## deg1.sbF.B                        1.046e+00  1.152e-01      0  < 1e-04 ***
## deg1.sbF.NB                       1.164e+00  1.162e-01      0  < 1e-04 ***
## deg1.sbM.B                        1.089e+00  1.634e-01      0  < 1e-04 ***
## deg1.sbM.NB                       1.587e+00  2.808e-01      0  < 1e-04 ***
## nodefactor.dsb.cohab.deg1pl.F.B  -4.415e+00  3.178e-01      0  < 1e-04 ***
## nodefactor.dsb.cohab.deg1pl.F.NB -5.349e+00  1.812e-01      0  < 1e-04 ***
## nodefactor.dsb.cohab.deg1pl.M.B  -3.974e+00  2.862e-01      0  < 1e-04 ***
## nodefactor.dsb.cohab.deg1pl.M.NB -4.678e+00  1.733e-01      0  < 1e-04 ***
## nodematch.sex                          -Inf  0.000e+00      0  < 1e-04 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## 
##  The following terms are fixed by offset and are not estimated:
##   netsize.adj nodematch.sex

4 mcmc.diagnostics()

mcmc.diagnostics(fit)
## Warning in formals(fun): argument is not a function

5 model gof.ergm.ego

6 model gof.ergm.ego

GOF time: 41.5 minutes.

7 Observed vs fitted network

7.1 This model, burnin 1,000,000

obs_v_fitted_net(fit, attributes=c('sex', 'race'))
## 
## ----------------------------------------
## All stats refer to popsize of  50000 
## ----------------------------------------
## PctDiff is %, e.g. 0.5 is 0.5% not 50%
## ----------------------------------------
## $edges
##                                Term    Target    Fitted PctDiff
## 1              absdiff.sqrt.age.adj    1459.9    1460.5     0.0
## 2                        deg1.sbF.B     319.9     321.0     0.3
## 3                       deg1.sbF.NB    3797.6    3798.0     0.0
## 4                        deg1.sbM.B     308.7     309.0     0.1
## 5                       deg1.sbM.NB    4149.1    4149.0     0.0
## 6                             edges    4663.8    4665.0     0.0
## 7                       nodecov.age  265613.7  265705.0     0.0
## 8                     nodecov.agesq 8163460.0 8166881.0     0.0
## 9   nodefactor.dsb.cohab.deg1pl.F.B       4.6       5.0     8.7
## 10 nodefactor.dsb.cohab.deg1pl.F.NB      59.4      60.0     1.0
## 11  nodefactor.dsb.cohab.deg1pl.M.B      10.9      11.0     0.9
## 12 nodefactor.dsb.cohab.deg1pl.M.NB     111.5     112.0     0.4
## 13                nodefactor.race.B     762.5     764.0     0.2
## 14               nodefactor.race.BI     367.4     367.0    -0.1
## 15                nodefactor.race.H     697.9     697.0    -0.1
## 16               nodefactor.race.HI     501.4     502.0     0.1
## 17        nodefactor.sex.ident.msmf      67.2      67.0    -0.3
## 18                 nodematch.race.B     267.1     268.0     0.3
## 19                nodematch.race.BI     101.3     101.0    -0.3
## 20                 nodematch.race.H     103.5     103.0    -0.5
## 21                nodematch.race.HI     129.7     130.0     0.2
## 22                 nodematch.race.W    3153.4    3154.0     0.0
## 
## $nodes
## $nodes$sex
##   ObsPerc FittedPerc PctDiff
## F    49.5       49.1    -0.8
## M    50.5       50.9     0.8
## 
## $nodes$race
##    ObsPerc FittedPerc PctDiff
## B      3.8        3.8     0.0
## BI     2.5        2.5     0.0
## H      4.6        4.7     2.2
## HI     6.4        6.5     1.6
## W     82.8       82.6    -0.2

7.2 Prior model, burnin 7500, ppop.wt=‘round’

fitP <- readRDS('/net/proj/SHAMPnetdat/model-fits/archive/apr-jkb/pers_mix_E245.rds')
obs_v_fitted_net(fitP, attributes=c('sex', 'race'))
## 
## ----------------------------------------
## All stats refer to popsize of  48210 
## ----------------------------------------
## PctDiff is %, e.g. 0.5 is 0.5% not 50%
## ----------------------------------------
## $edges
##                    Term    Target    Fitted PctDiff
## 1  absdiff.sqrt.age.adj    1408.4    1390.1    -1.3
## 2                 edges    4496.8    4434.0    -1.4
## 3           nodecov.age  256104.7  252853.0    -1.3
## 4         nodecov.agesq 7871208.2 7779711.0    -1.2
## 5     nodefactor.race.B     735.2     608.0   -17.3
## 6    nodefactor.race.BI     354.2     355.0     0.2
## 7     nodefactor.race.H     672.9     673.0     0.0
## 8    nodefactor.race.HI     483.4     483.0    -0.1
## 9      nodematch.race.B     257.6     194.0   -24.7
## 10    nodematch.race.BI      97.6      98.0     0.4
## 11     nodematch.race.H      99.8     100.0     0.2
## 12    nodematch.race.HI     125.0     125.0     0.0
## 13     nodematch.race.W    3040.5    3041.0     0.0
## 
## $nodes
## $nodes$sex
##   ObsPerc FittedPerc PctDiff
## F    49.5         49      -1
## M    50.5         51       1
## 
## $nodes$race
##    ObsPerc FittedPerc PctDiff
## B      3.8        2.3   -39.5
## BI     2.5        2.6     4.0
## H      4.6        3.8   -17.4
## HI     6.4        6.1    -4.7
## W     82.8       85.2     2.9

8 Total runtime

Approximately 844 minutes.